home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / falclib2.lzh / ROUTS / COOKIE.S < prev    next >
Text File  |  1994-08-17  |  386b  |  30 lines

  1. *
  2. * COOKIE.S
  3. *
  4. *    Finds and returns a Cookie. Supervisor only!
  5. *
  6. * In    d1.l=Cookie name
  7. * Out    d0.l=Cookie value or -1
  8. *    (destroys a0)
  9. *
  10.  
  11. @getcookie
  12.     move.l    $5a0,a0
  13.     move.l    a0,d0
  14.     beq.s    .failed
  15. .loop    move.l    (a0)+,d0
  16.     beq.s    .failed
  17.     cmp.l    d0,d1
  18.     beq.s    .success
  19.     addq.l    #4,a0
  20.     bra.s    .loop
  21.  
  22. .success
  23.     move.l    (a0)+,d0
  24.     cmp.b    d0,d0
  25.     rts
  26.  
  27. .failed
  28.     moveq    #-1,d0
  29.     rts
  30.